//
//  ClassifyCell.m
//  SYPerfectDemo
//
//  Created by Lssyyy on 2018/4/27.
//  Copyright © 2018年 Lssyyy. All rights reserved.
//

#import "ClassifyCell.h"

@implementation ClassifyCell{
    UILabel *_titleLb;
}

- (void)addUI{
    _titleLb = [UILabel new];
    _titleLb.textColor = [UIColor blackColor];
    _titleLb.numberOfLines = 0;
    [self.contentView addSubview:_titleLb];
}

- (void)layoutUI{
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView);
        make.height.mas_equalTo(150);
    }];
}

- (void)configContent:(NSString *)content{
    _titleLb.text = content;
}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
    [super setHighlighted:highlighted animated:animated];
    if (self.highlighted) {
        POPBasicAnimation *scaleAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewScaleXY];
        scaleAnimation.duration = 0.1;
        scaleAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(1, 1)];
        [_titleLb pop_addAnimation:scaleAnimation forKey:@"scalingUp"];
        
        
        
    } else {
        POPSpringAnimation *sprintAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewScaleXY];
        sprintAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(0.9, 0.9)];
        sprintAnimation.velocity = [NSValue valueWithCGPoint:CGPointMake(2, 2)];
        sprintAnimation.springBounciness = 20.f;
        [_titleLb pop_addAnimation:sprintAnimation forKey:@"springAnimation"];
    }
}

@end
